This disclosure relates generally to computer system filesystem management, and more particularly to splitting a clone having snapshots from a parent.
Redirect-on-write (ROW) file systems write modified data to new storage locations rather than modifying the data in a previous location or copying original data prior to making the modification. A snapshot of a file system object is created by having the snapshot point to the same locations for the data. A new modification of the object writes the data to a new location and leaves the snapshot's point-in-time view unchanged. For unchanged data this operation can result in sharing data blocks, where more than one object points to the same data block in the file system.
A clone of a snapshot can be created which starts pointing to all of the same data as the snapshot. Unlike the snapshot, the clone can be modified. With ROW, a block modified in the clone results in a new block being allocated to the clone but no change to the snapshot. A clone can itself have a snapshot created from it as well. For unchanged data, more than one object can point to the same data block in the file system.
Sharing of data blocks presents an issue when splitting the connection between a clone and its parent snapshot or from the clone and its child objects. Generally, in splitting a clone from its parent snapshot, all blocks shared between the clone and its parent snapshot are located, and each block is duplicated to a new location for the clone to address. The object referring to the block is updated to point to the new location.
For a clone having snapshots, the blocks inherited from the clone's parent snapshot can be shared between the clone and all of the clone's snapshots, or only a subset of the clone's snapshots. If each occurrence of a block is moved to a new location, then available space in the file system can be exhausted since multiple copies of the same block are needed.